
#import "TextAppend.h"

@implementation Text(Append)

/* appendString: - append value of a string to the end of Text. */
- (void)appendString:(NSString *)aString
{
    [self setSel:[self textLength] :[self textLength]];
    [self replaceSel:[aString cString]];
    [self scrollSelToVisible];
}

/* appendString: - append value of a string to the end of Text with a specific font style. */
- (void)appendString:(NSString *)aString withFontStyle:(NXFontTraitMask)traits
{
	int originalLength = [self textLength];

	//** append text
    [self appendString:aString];

	//** set font style
	[self setSel:originalLength :[self textLength]];
	[self setSelFontStyle:traits];
}

@end